<tc_include file="Public:head" />
<div class="container" id="container">
    <div class="page">
        <div class="page__bd" style="height: 100%; overflow: hidden;">
            <div class="weui-tab">
                <div class="weui-tab__panel">
                    <div class="weui-panel weui-panel_access">
                        <!--newlist-->
                        <div id="newList">
                            <volist name="activitys" id="activity">
                                <a href="{:U('Index/activity_detail',array('id'=>$activity['id']))}" class="weui-media-box weui-media-box_appmsg">
                                    <div class="weui-media-box__hd">
                                        <img class="weui-media-box__thumb" src="<php>echo '/'.C('UPLOADPATH').$activity['activity_icon']</php>" alt="">
                                    </div>
                                    <div class="weui-media-box__bd">
                                        <h4 class="weui-media-box__title">
                                            <span>
                                                <if condition="$activity['activity_brand_type'] eq 1 ">[品牌]
                                                    <elseif condition="$activity['activity_brand_type'] eq 2 "/>[商户]
                                                    <elseif condition="$activity['activity_brand_type'] eq 3 "/>[联合]
                                                </if>
                                            </span> {$activity['activity_title']}</h4>
                                        <p class="weui-media-box__desc">{$activity['activity_intro']}</p>
                                        <p class="weui-media-box__time">活动时间：{$activity['activity_start_time']|strtotime|date="m.d",###}-{$activity['activity_end_time']|strtotime|date="m.d",###}</p>
                                    </div>
                                </a>
                            </volist>
                        </div>
                        <div class="weui-loadmore" id="loading" style="display: none;">
                            <i class="weui-loading"></i>
                            <span class="weui-loadmore__tips">正在加载</span>
                        </div>
                        <div class="weui-loadmore weui-loadmore_line" style="display: none;" id="unloading">
                            <span class="weui-loadmore__tips">暂无数据</span>
                        </div>
                        <!--newlist end-->
                    </div>
                </div>
                <tc_include file="Public:menu" />
            </div>
        </div>
    </div>
</div>
<tc_include file="Public:footer" />
<script src="__TMPL__Public/assets/js/touch.js"></script>
<script>
    var loading = false;
    var page=0;
    $(".weui-panel_access").swipeUp(function(){
        page++
        if(loading) return;
        if(page>1) {
            loading=false;
            $("#loading").hide();
            $("#unloading").show();
            return;
        }
        loading = true;
        var html="";
        for(i=0;i<5;i++){
            html=html+'<a href="javascript:void(0);" class="weui-media-box weui-media-box_appmsg">'
                    +'  <div class="weui-media-box__hd">'
                    +'      <img class="weui-media-box__thumb" src="./images/activity/004.jpg" alt="">'
                    +'  </div>'
                    +'  <div class="weui-media-box__bd">'
                    +'      <h4 class="weui-media-box__title"><span>[商户]</span> 美食家点评名额限定开放，秋月夜日料限定与你相约...</h4>'
                    +'          <p class="weui-media-box__desc">这里是活动内容的一些简略介绍，便于消费者快速了解活动的主要内容和精彩要点，参与报名......</p>'
                    +'          <p class="weui-media-box__time">活动时间：08.12-08.15</p>'
                    +'  </div>'
                    +'</a>'
        }

        setTimeout(function() {
            $("#newList").append(html);
            loading = false;
        }, 2000);

    })
</script>

